#include<unistd.h>
#include<stdio.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
#define FILENAME "mkfifo"
int main()
{
    int fd=open(FILENAME,O_WRONLY);
    if(fd<0)
    {
        perror("open file");
        return 1;
    }
    while(1)
    {
        char msg[1024];
        printf("Please Enter: ");
        fflush(stdout);
        ssize_t n=read(0,msg,sizeof(msg));
        if(n>0)
        {
            msg[n]=0;
            write(fd,msg,n);
        }
        else
        {
            break;
        }
        
    }
    close(fd);
    return 0;
}